cargo.git
9 years agoAuto merge of #2670 - matklad:simplify-tests, r=alexcrichton
bors [Wed, 11 May 2016 22:13:55 +0000 (15:13 -0700)]
Auto merge of #2670 - matklad:simplify-tests, r=alexcrichton

Simplify tests

@alexcrichton I think there is one bit of tests that could be simplified.

What do you think about writing this

```Rust
test!(simple {
    pkg("foo", "0.0.1");

    assert_that(cargo_process("install").arg("foo"),
                execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] foo v0.0.1 (registry file://[..])
[COMPILING] foo v0.0.1 (registry file://[..])
[INSTALLING] {home}[..]bin[..]foo[..]
",
        home = cargo_home().display())));
    assert_that(cargo_home(), has_installed_exe("foo"));

    assert_that(cargo_process("uninstall").arg("foo"),
                execs().with_status(0).with_stdout(&format!("\
[REMOVING] {home}[..]bin[..]foo[..]
",
        home = cargo_home().display())));
    assert_that(cargo_home(), is_not(has_installed_exe("foo")));
});
```

instead of this

```Rust
test!(simple {
    pkg("foo", "0.0.1");

    assert_that(cargo_process("install").arg("foo"),
                execs().with_status(0).with_stdout(&format!("\
{updating} registry `[..]`
{downloading} foo v0.0.1 (registry file://[..])
{compiling} foo v0.0.1 (registry file://[..])
{installing} {home}[..]bin[..]foo[..]
",
        updating = UPDATING,
        downloading = DOWNLOADING,
        compiling = COMPILING,
        installing = INSTALLING,
        home = cargo_home().display())));
    assert_that(cargo_home(), has_installed_exe("foo"));

    assert_that(cargo_process("uninstall").arg("foo"),
                execs().with_status(0).with_stdout(&format!("\
{removing} {home}[..]bin[..]foo[..]
",
        removing = REMOVING,
        home = cargo_home().display())));
    assert_that(cargo_home(), is_not(has_installed_exe("foo")));
});
```

This PR has a proof of concept implementation of this feature applied to a couple of tests.

r? @alexcrichton

9 years agosimplify tests
Aleksey Kladov [Wed, 11 May 2016 16:55:43 +0000 (19:55 +0300)]
simplify tests

remove RUNNING, COMPILING, ERROR, DOCUMENTING, FRESH and UPDATING
constants

9 years agoAuto merge of #2669 - mbrubeck:dev-dep-doc, r=alexcrichton
bors [Wed, 11 May 2016 06:37:09 +0000 (23:37 -0700)]
Auto merge of #2669 - mbrubeck:dev-dep-doc, r=alexcrichton

Document that dev-dependencies are used when building examples

None

9 years agoSimplify tests
Aleksey Kladov [Tue, 10 May 2016 23:52:02 +0000 (02:52 +0300)]
Simplify tests

9 years agoDocument that dev-dependencies are used when building examples
Matt Brubeck [Tue, 10 May 2016 21:37:25 +0000 (14:37 -0700)]
Document that dev-dependencies are used when building examples

9 years agoAuto merge of #2666 - matklad:simplify, r=alexcrichton
bors [Mon, 9 May 2016 04:58:01 +0000 (21:58 -0700)]
Auto merge of #2666 - matklad:simplify, r=alexcrichton

Simplify error printing

9 years agoSimplify error printing
Aleksey Kladov [Sun, 8 May 2016 21:22:46 +0000 (00:22 +0300)]
Simplify error printing

9 years agoAuto merge of #2656 - knight42:fix, r=alexcrichton
bors [Fri, 6 May 2016 17:49:57 +0000 (10:49 -0700)]
Auto merge of #2656 - knight42:fix, r=alexcrichton

zsh: enable autocompletion for sub-command `init`

9 years agoAuto merge of #2647 - alx741:improve-manpage, r=alexcrichton
bors [Fri, 6 May 2016 17:13:02 +0000 (10:13 -0700)]
Auto merge of #2647 - alx741:improve-manpage, r=alexcrichton

Man page: Improve build command section

Addresses #2645

This is a proposal for improving the documentation available in the man page about each command; It has been applied to the **build** command only, if it is useful i will do the same with the other ones.

9 years agoAuto merge of #2653 - frewsxcv:cleanup, r=alexcrichton
bors [Fri, 6 May 2016 16:19:36 +0000 (09:19 -0700)]
Auto merge of #2653 - frewsxcv:cleanup, r=alexcrichton

A few cleanup commits.

None

9 years agozsh: enable autocompletion for sub-command `init`
Knight [Fri, 6 May 2016 12:00:51 +0000 (20:00 +0800)]
zsh: enable autocompletion for sub-command `init`

9 years agoAdd man sub-pages in Makefile.in
Daniel Campoverde [alx741] [Fri, 6 May 2016 04:36:32 +0000 (23:36 -0500)]
Add man sub-pages in Makefile.in

9 years agoMan page: Add cargo-build page
Daniel Campoverde [alx741] [Fri, 6 May 2016 04:27:28 +0000 (23:27 -0500)]
Man page: Add cargo-build page

9 years agoMan page: Add reference to cargo-build page
Daniel Campoverde [alx741] [Fri, 6 May 2016 04:27:09 +0000 (23:27 -0500)]
Man page: Add reference to cargo-build page

9 years agoUtilize `if let` over single branch `match`.
Corey Farwell [Fri, 6 May 2016 01:36:13 +0000 (21:36 -0400)]
Utilize `if let` over single branch `match`.

9 years agoRemove `String` ownership constraint, fewer allocations.
Corey Farwell [Thu, 5 May 2016 23:07:36 +0000 (19:07 -0400)]
Remove `String` ownership constraint, fewer allocations.

9 years agoTurn `url_ref` utility function into method.
Corey Farwell [Thu, 5 May 2016 22:40:47 +0000 (18:40 -0400)]
Turn `url_ref` utility function into method.

9 years agoAuto merge of #2648 - frewsxcv:unused-to-url, r=alexcrichton
bors [Thu, 5 May 2016 02:50:09 +0000 (19:50 -0700)]
Auto merge of #2648 - frewsxcv:unused-to-url, r=alexcrichton

Remove unused `ToUrl` impls.

None

9 years agoRemove unused `ToUrl` impls.
Corey Farwell [Thu, 5 May 2016 01:46:36 +0000 (21:46 -0400)]
Remove unused `ToUrl` impls.

9 years agoMan page: Improve build command section
Daniel Campoverde [alx741] [Thu, 5 May 2016 00:38:50 +0000 (19:38 -0500)]
Man page: Improve build command section

9 years agoAuto merge of #2635 - frewsxcv:toml-cleanup, r=alexcrichton
bors [Wed, 4 May 2016 02:17:14 +0000 (19:17 -0700)]
Auto merge of #2635 - frewsxcv:toml-cleanup, r=alexcrichton

Various cleanup in `src/cargo/util/toml.rs`.

None

9 years agoAuto merge of #2639 - SimonSapin:url-1.0, r=alexcrichton
bors [Tue, 3 May 2016 22:11:27 +0000 (15:11 -0700)]
Auto merge of #2639 - SimonSapin:url-1.0, r=alexcrichton

Update to rust-url 1.x

This is ready to go now :)

9 years agoAuto merge of #2634 - frewsxcv:flake8, r=alexcrichton
bors [Tue, 3 May 2016 17:59:34 +0000 (10:59 -0700)]
Auto merge of #2634 - frewsxcv:flake8, r=alexcrichton

Address flake8 issues.

None

9 years agoUpdate to rust-url 1.x
Simon Sapin [Wed, 2 Mar 2016 15:37:44 +0000 (16:37 +0100)]
Update to rust-url 1.x

9 years agoAuto merge of #2636 - sanxiyn:unused-trait-import, r=alexcrichton
bors [Tue, 3 May 2016 16:40:16 +0000 (09:40 -0700)]
Auto merge of #2636 - sanxiyn:unused-trait-import, r=alexcrichton

Remove unused trait imports

9 years agoUpdate OpenSSL version to 1.0.2h
Seo Sanghyeon [Tue, 3 May 2016 16:37:19 +0000 (01:37 +0900)]
Update OpenSSL version to 1.0.2h

9 years agoRemove unused trait imports
Seo Sanghyeon [Tue, 3 May 2016 09:21:27 +0000 (18:21 +0900)]
Remove unused trait imports

9 years agoUtilize `if let` construct over single branch `match`.
Corey Farwell [Tue, 3 May 2016 01:18:14 +0000 (21:18 -0400)]
Utilize `if let` construct over single branch `match`.

9 years agoRemove unnecessary `Vec` allocation when iterating.
Corey Farwell [Tue, 3 May 2016 01:17:01 +0000 (21:17 -0400)]
Remove unnecessary `Vec` allocation when iterating.

9 years agoRefactor `TomlTarget` validation functions into methods.
Corey Farwell [Tue, 3 May 2016 01:04:26 +0000 (21:04 -0400)]
Refactor `TomlTarget` validation functions into methods.

9 years agoUse constructor pattern for `project_layout` in `toml.rs`.
Corey Farwell [Tue, 3 May 2016 00:59:39 +0000 (20:59 -0400)]
Use constructor pattern for `project_layout` in `toml.rs`.

9 years agoMinor whitespace fixes for flake8.
Corey Farwell [Tue, 3 May 2016 00:26:41 +0000 (20:26 -0400)]
Minor whitespace fixes for flake8.

9 years agoRemove unused Python imports.
Corey Farwell [Tue, 3 May 2016 00:25:05 +0000 (20:25 -0400)]
Remove unused Python imports.

9 years agoAuto merge of #2405 - gkoz:reinstall, r=alexcrichton
bors [Mon, 2 May 2016 16:54:56 +0000 (09:54 -0700)]
Auto merge of #2405 - gkoz:reinstall, r=alexcrichton

Add `--force` flag to cargo install

Close #2082.

Adding `--force` (`-f`) instructs cargo to overwrite existing binaries (updating the metadata accordingly).
This allows updating crates via `cargo install -f <crate>`.

Installation happens in two stages now: binaries are copied into a temporary subdirectory of the destination first, then moved into destination. This should catch some errors earlier.

In case of installation error cargo will remove new binaries but won't attempt to undo successful overwrites.

9 years agocargo-install: move binaries from the build dir if possible
Gleb Kozyrev [Sat, 30 Apr 2016 23:46:41 +0000 (02:46 +0300)]
cargo-install: move binaries from the build dir if possible

Try moving the binaries (and fall back to copying) if the build
directory is a temporary one (source isn't a local path).

9 years agoAdd `--force` flag to cargo install
Gleb Kozyrev [Fri, 15 Apr 2016 11:20:45 +0000 (14:20 +0300)]
Add `--force` flag to cargo install

Close #2082

Adding `--force` (`-f`) instructs cargo to overwrite existing binaries
(updating the metadata accordingly).
This allows updating crates via `cargo install -f <crate>`.

Installation happens in two stages now: binaries are copied into a
temporary subdirectory of the destination first, then moved into
destination. This should catch some errors earlier.

In case of installation error cargo will remove new binaries but won't
attempt to undo successful overwrites.

9 years agoAuto merge of #2629 - alexcrichton:moar-rustflags, r=brson
bors [Sat, 30 Apr 2016 00:46:56 +0000 (17:46 -0700)]
Auto merge of #2629 - alexcrichton:moar-rustflags, r=brson

Pass RUSTFLAGS when we learn about target info

This should help us learn about `target_feature` additions!

Closes #2628

9 years agoPass RUSTFLAGS when we learn about target info
Alex Crichton [Fri, 29 Apr 2016 23:36:55 +0000 (16:36 -0700)]
Pass RUSTFLAGS when we learn about target info

This should help us learn about `target_feature` additions!

Closes #2628

9 years agoAuto merge of #2623 - alexcrichton:nfs-lol-no, r=brson
bors [Fri, 29 Apr 2016 17:15:47 +0000 (10:15 -0700)]
Auto merge of #2623 - alexcrichton:nfs-lol-no, r=brson

Don't use flock on NFS mounts

Completely skip file locking when we detect an NFS mount via `statfs`.

Closes #2615

9 years agoAuto merge of #2625 - aidanhs:aphs-path-crates-io, r=alexcrichton
bors [Wed, 27 Apr 2016 17:00:37 +0000 (10:00 -0700)]
Auto merge of #2625 - aidanhs:aphs-path-crates-io, r=alexcrichton

`path` dependencies are ignored from crates.io

9 years ago`path` dependencies are ignored from crates.io
Aidan Hobson Sayers [Wed, 27 Apr 2016 14:54:58 +0000 (15:54 +0100)]
`path` dependencies are ignored from crates.io

9 years agoDon't use flock on NFS mounts
Alex Crichton [Tue, 26 Apr 2016 22:58:49 +0000 (15:58 -0700)]
Don't use flock on NFS mounts

Completely skip file locking when we detect an NFS mount via `statfs`.

Closes #2615

9 years agoAuto merge of #2619 - japaric:freebsd32, r=alexcrichton
bors [Tue, 26 Apr 2016 06:11:10 +0000 (23:11 -0700)]
Auto merge of #2619 - japaric:freebsd32, r=alexcrichton

prepare for i686-unknown-freebsd nightlies

Tested with:

```
$ python -B src/etc/install-deps.py
$ ./configure --local-rust-root=$PWD/rustc --enable-optimize --enable-nightly --target=i686-unknown-freebsd
$ make
```

r? @alexcrichton

9 years agoprepare for i686-unknown-freebsd nightlies
Jorge Aparicio [Tue, 26 Apr 2016 05:22:30 +0000 (00:22 -0500)]
prepare for i686-unknown-freebsd nightlies

9 years agoAuto merge of #2617 - sanxiyn:reset-rustflags, r=alexcrichton
bors [Mon, 25 Apr 2016 16:17:58 +0000 (09:17 -0700)]
Auto merge of #2617 - sanxiyn:reset-rustflags, r=alexcrichton

Reset RUSTFLAGS when running tests

9 years agoReset RUSTFLAGS when running tests
Seo Sanghyeon [Mon, 25 Apr 2016 13:58:09 +0000 (22:58 +0900)]
Reset RUSTFLAGS when running tests

9 years agoAuto merge of #2610 - japaric:install-from-tempdir, r=alexcrichton
bors [Sun, 24 Apr 2016 05:15:19 +0000 (22:15 -0700)]
Auto merge of #2610 - japaric:install-from-tempdir, r=alexcrichton

cargo-install: prefer building artifacts in the system temporary directory

and each cargo-install instance creates and uses its own build directory. This
allows running several cargo-install instances in parallel.

If we fail to create a temporary directory for whatever reason fallback to
creating and using a target-install directory in the current directory.

closes #2606

---

r? @alexcrichton

Qs:
- Should we preserve the current behavior (`target-install` in `cwd`) as a fallback or remove it and error if we can't create a `TempDir` in `env::temp_dir()`? (we currently error if we can't create `target-install` directory in `cwd`)

- Should I add tests for the issues I raised at #2606? If yes, how can I test `cargo-install` parallelism? Lack of "Blocking waiting for file lock on build directory" in the output of the `cargo` commands? or something else?

9 years agoadd tests for #2606
Jorge Aparicio [Sat, 23 Apr 2016 03:33:58 +0000 (22:33 -0500)]
add tests for #2606

9 years agocargo-install: prefer building artifacts in the system temporary directory
Jorge Aparicio [Fri, 22 Apr 2016 22:49:12 +0000 (17:49 -0500)]
cargo-install: prefer building artifacts in the system temporary directory

and each cargo-install instance creates and uses its own build directory. This
allows running several cargo-install instances in parallel.

If we fail to create a temporary directory for whatever reason fallback to
creating and using a target-install directory in the current directory.

closes #2606

9 years agoAuto merge of #2602 - durka:patch-5, r=alexcrichton
bors [Thu, 21 Apr 2016 18:16:01 +0000 (11:16 -0700)]
Auto merge of #2602 - durka:patch-5, r=alexcrichton

fix rerun-if-changed documentation

The documentation corresponded to the initial proposed implementation, which was changed to remove special handling of directories before it was ever merged.

closes #2599
r? @alexcrichton

9 years agofix rerun-if-changed documentation
Alex Burka [Thu, 21 Apr 2016 17:55:24 +0000 (13:55 -0400)]
fix rerun-if-changed documentation

The documentation corresponded to the initial proposed implementation, which was changed to remove special handling of directories before it was ever merged.

9 years agoAuto merge of #2578 - alexcrichton:test-doc, r=brson
bors [Thu, 21 Apr 2016 17:40:42 +0000 (10:40 -0700)]
Auto merge of #2578 - alexcrichton:test-doc, r=brson

Add `cargo test --doc`

Supports testing only the documentation (like `--lib`, `--bin`, etc).

9 years agoAuto merge of #2551 - alexcrichton:explain, r=brson
bors [Thu, 21 Apr 2016 17:09:27 +0000 (10:09 -0700)]
Auto merge of #2551 - alexcrichton:explain, r=brson

Add support for `cargo --explain`

The error messages in the compiler are being tweaked and will likely drop the
`rustc --explain` part of the error message in favor of `--explain`. In that
case you're expected to basically take whatever tool you're using and pass
`--explain` to it with an error code, so let's add it to Cargo as well!

9 years agoAdd support for `cargo --explain`
Alex Crichton [Fri, 8 Apr 2016 00:27:49 +0000 (17:27 -0700)]
Add support for `cargo --explain`

The error messages in the compiler are being tweaked and will likely drop the
`rustc --explain` part of the error message in favor of `--explain`. In that
case you're expected to basically take whatever tool you're using and pass
`--explain` to it with an error code, so let's add it to Cargo as well!

9 years agoAuto merge of #2576 - alexcrichton:silence-warnings-with-q, r=brson
bors [Thu, 21 Apr 2016 16:34:38 +0000 (09:34 -0700)]
Auto merge of #2576 - alexcrichton:silence-warnings-with-q, r=brson

Don't print warnings when -q is passed

Closes #2571

9 years agoAuto merge of #2579 - alexcrichton:robust-submodule, r=brson
bors [Wed, 20 Apr 2016 18:51:57 +0000 (11:51 -0700)]
Auto merge of #2579 - alexcrichton:robust-submodule, r=brson

Remove submodule directory before cloning

If the directory is in a corrupt state that caused an existing repository to not
successfully open, then we'll want to blow it away anything that already exists
to ensure we start from a clean slate.

Closes #2567

9 years agoAuto merge of #2577 - alexcrichton:doc-lib-flags, r=brson
bors [Wed, 20 Apr 2016 18:06:54 +0000 (11:06 -0700)]
Auto merge of #2577 - alexcrichton:doc-lib-flags, r=brson

Add `cargo doc --lib/--bin`

Allows documenting a specific target.

Closes #2557

9 years agoAuto merge of #2560 - alexcrichton:not-all-utf8, r=brson
bors [Wed, 20 Apr 2016 17:12:50 +0000 (10:12 -0700)]
Auto merge of #2560 - alexcrichton:not-all-utf8, r=brson

Don't require all build script output to be utf-8

Build scripts often stream output of native build systems like cmake/make and
those aren't always guaranteed to produce utf-8 output. For example  German
MSVC cmake build has been reported to print non-utf-8 umlauts.

This commit instead only attempts to interpret each line as utf-8 rather than
the entire build script output. All non-utf-8 output is ignored.

Closes #2556

9 years agoAuto merge of #2501 - ryanq:issue2266, r=alexcrichton
bors [Wed, 20 Apr 2016 16:09:52 +0000 (09:09 -0700)]
Auto merge of #2501 - ryanq:issue2266, r=alexcrichton

Check local targets before resolving dependencies

A call to `generate_targets(...)` before calling `resolve_dependencies()`
catches invalid target names before fetching the source for the
dependencies.

Closes #2266

9 years agoAuto merge of #2592 - jethrogb:topic/list-symlinks, r=alexcrichton
bors [Tue, 19 Apr 2016 22:32:11 +0000 (15:32 -0700)]
Auto merge of #2592 - jethrogb:topic/list-symlinks, r=alexcrichton

Use stat() instead of lstat() in cargo --list

The OS-specific implementation is necessary because according to the docs, [DirEntry::metadata is fast on Windows](https://doc.rust-lang.org/stable/std/fs/struct.DirEntry.html#method.metadata). Note  `is_executable` is used elsewhere so we can't change that directly to accept `DirEntry` instead of `Metadata`.

Fixes #2591

9 years agoFix dead code lints on Windows
Jethro Beekman [Tue, 19 Apr 2016 20:55:37 +0000 (13:55 -0700)]
Fix dead code lints on Windows

9 years agoStyle issue
Jethro Beekman [Tue, 19 Apr 2016 19:19:51 +0000 (12:19 -0700)]
Style issue

9 years agoAdd test list_command_resolves_symlinks
Jethro Beekman [Tue, 19 Apr 2016 19:00:30 +0000 (12:00 -0700)]
Add test list_command_resolves_symlinks

9 years agoTests: fix grammar and extra semicolon
Jethro Beekman [Tue, 19 Apr 2016 18:59:55 +0000 (11:59 -0700)]
Tests: fix grammar and extra semicolon

9 years agoStyle issue
Jethro Beekman [Tue, 19 Apr 2016 18:59:25 +0000 (11:59 -0700)]
Style issue

9 years agoAuto merge of #2590 - alexcrichton:dont-warn-about-flags-and-configs, r=brson
bors [Tue, 19 Apr 2016 18:46:40 +0000 (11:46 -0700)]
Auto merge of #2590 - alexcrichton:dont-warn-about-flags-and-configs, r=brson

Have CLI take preference over config for verbosity

If a CLI option is passed, that trumps any command line configuration, otherwise
just do what we did previously.

Closes #2588

9 years agoUse stat() instead of lstat() in cargo --list. Fixes #2591
Jethro Beekman [Tue, 19 Apr 2016 00:05:06 +0000 (17:05 -0700)]
Use stat() instead of lstat() in cargo --list. Fixes #2591

9 years agoHave CLI take preference over config for verbosity
Alex Crichton [Mon, 18 Apr 2016 05:02:44 +0000 (22:02 -0700)]
Have CLI take preference over config for verbosity

If a CLI option is passed, that trumps any command line configuration, otherwise
just do what we did previously.

Closes #2588

9 years agoAuto merge of #2584 - alexcrichton:auth-more, r=brson
bors [Mon, 18 Apr 2016 04:53:11 +0000 (21:53 -0700)]
Auto merge of #2584 - alexcrichton:auth-more, r=brson

Correctly attempt multiple usernames with libgit2

This commit corrects the logic for attempting multiple usernames with libgit2.
There is a restriction that for each authentication seession you can only
authenticate with one ssh username, but we were attempting multiple as part of
the same sesssion. Instead restart authentication whenever we try a new username.

Closes #2399

9 years agoCorrectly attempt multiple usernames with libgit2
Alex Crichton [Sat, 16 Apr 2016 00:45:30 +0000 (17:45 -0700)]
Correctly attempt multiple usernames with libgit2

This commit corrects the logic for attempting multiple usernames with libgit2.
There is a restriction that for each authentication seession you can only
authenticate with one ssh username, but we were attempting multiple as part of
the same sesssion. Instead restart authentication whenever we try a new username.

Closes #2399

9 years agoMerge pull request #2587 from birkenfeld/docmenu
Alex Crichton [Sun, 17 Apr 2016 16:41:46 +0000 (09:41 -0700)]
Merge pull request #2587 from birkenfeld/docmenu

Doc dropdown menu: name "Cargo.toml" explicitly

9 years agoDoc dropdown menu: name "Cargo.toml" explicitly
Georg Brandl [Sun, 17 Apr 2016 06:18:55 +0000 (08:18 +0200)]
Doc dropdown menu: name "Cargo.toml" explicitly

9 years agoAdd `cargo test --doc`
Alex Crichton [Thu, 14 Apr 2016 17:37:16 +0000 (10:37 -0700)]
Add `cargo test --doc`

Supports testing only the documentation (like `--lib`, `--bin`, etc).

9 years agoAdd `cargo doc --lib/--bin`
Alex Crichton [Thu, 14 Apr 2016 17:32:35 +0000 (10:32 -0700)]
Add `cargo doc --lib/--bin`

Allows documenting a specific target.

Closes #2557

9 years agoRemove submodule directory before cloning
Alex Crichton [Thu, 14 Apr 2016 17:40:36 +0000 (10:40 -0700)]
Remove submodule directory before cloning

If the directory is in a corrupt state that caused an existing repository to not
successfully open, then we'll want to blow it away anything that already exists
to ensure we start from a clean slate.

Closes #2567

9 years agoAuto merge of #2575 - alexcrichton:bump, r=alexcrichton
bors [Thu, 14 Apr 2016 17:36:06 +0000 (10:36 -0700)]
Auto merge of #2575 - alexcrichton:bump, r=alexcrichton

Bump to 0.11.0

9 years agoDon't print warnings when -q is passed
Alex Crichton [Thu, 14 Apr 2016 17:25:25 +0000 (10:25 -0700)]
Don't print warnings when -q is passed

Closes #2571

9 years agoBump to 0.11.0
Alex Crichton [Thu, 14 Apr 2016 17:10:02 +0000 (10:10 -0700)]
Bump to 0.11.0

9 years agoAuto merge of #2574 - alexcrichton:crates-io-bump, r=alexcrichton
bors [Thu, 14 Apr 2016 17:05:05 +0000 (10:05 -0700)]
Auto merge of #2574 - alexcrichton:crates-io-bump, r=alexcrichton

Bump the crates-io crate to 0.2

9 years agoBump the crates-io crate to 0.2
Alex Crichton [Thu, 14 Apr 2016 17:04:23 +0000 (10:04 -0700)]
Bump the crates-io crate to 0.2

9 years agoAuto merge of #2562 - smaximov:doc-add-env-vars, r=alexcrichton
bors [Tue, 12 Apr 2016 15:14:33 +0000 (08:14 -0700)]
Auto merge of #2562 - smaximov:doc-add-env-vars, r=alexcrichton

Document env vars introduced in PR #2523 to the docs

Document environment variables introduced in #2523 (`CARGO_PKG_NAME`, `CARGO_PKG_DESCRIPTION`, `CARGO_PKG_HOMEPAGE`).

9 years agoAdd reference to env vars introduced in PR #2523 to the docs
smaximov [Tue, 12 Apr 2016 10:32:11 +0000 (20:32 +1000)]
Add reference to env vars introduced in PR #2523 to the docs

9 years agoAuto merge of #2561 - alexcrichton:update-tar, r=alexcrichton
bors [Mon, 11 Apr 2016 20:40:12 +0000 (13:40 -0700)]
Auto merge of #2561 - alexcrichton:update-tar, r=alexcrichton

Update dependency on tar

Includes a fix for alexcrichton/tar-rs#61

9 years agoUpdate dependency on tar
Alex Crichton [Mon, 11 Apr 2016 19:55:38 +0000 (12:55 -0700)]
Update dependency on tar

Includes a fix for alexcrichton/tar-rs#61

9 years agoDon't require all build script output to be utf-8
Alex Crichton [Mon, 11 Apr 2016 17:06:47 +0000 (10:06 -0700)]
Don't require all build script output to be utf-8

Build scripts often stream output of native build systems like cmake/make and
those aren't always guaranteed to produce utf-8 output. For example  German
MSVC cmake build has been reported to print non-utf-8 umlauts.

This commit instead only attempts to interpret each line as utf-8 rather than
the entire build script output. All non-utf-8 output is ignored.

Closes #2556

9 years agoAuto merge of #2554 - alexcrichton:robust-test, r=alexcrichton
bors [Fri, 8 Apr 2016 20:31:50 +0000 (13:31 -0700)]
Auto merge of #2554 - alexcrichton:robust-test, r=alexcrichton

Make a test a bit more robust to the environment

Don't filter out PATH as `rustc` may be in that directory (e.g. when using
rustup) and otherwise just have a longer subcommand.

Closes #2553

9 years agoMake a test a bit more robust to the environment
Alex Crichton [Fri, 8 Apr 2016 20:30:45 +0000 (13:30 -0700)]
Make a test a bit more robust to the environment

Don't filter out PATH as `rustc` may be in that directory (e.g. when using
rustup) and otherwise just have a longer subcommand.

Closes #2553

9 years agoAuto merge of #2465 - TheNeikos:add-version_env, r=alexcrichton
bors [Fri, 8 Apr 2016 18:53:24 +0000 (11:53 -0700)]
Auto merge of #2465 - TheNeikos:add-version_env, r=alexcrichton

Add a new CARGO_PKG_AUTHORS environment variable

This will allow crates to use the CARGO_PKG_AUTHORS env variable to get a comma
seperated list of the authors declared in the manifest.

Closes #2441

9 years agoAdd a new CARGO_PKG_AUTHORS environment variable
Marcel Müller [Thu, 10 Mar 2016 09:35:50 +0000 (10:35 +0100)]
Add a new CARGO_PKG_AUTHORS environment variable

This will allow crates to use the CARGO_PKG_AUTHORS env variable to get a colon
seperated list of the authors declared in the manifest.

Closes #2441

9 years agoMerge remote-tracking branch 'origin/master' into issue2266
Ryan Quattlebaum [Fri, 8 Apr 2016 16:57:34 +0000 (12:57 -0400)]
Merge remote-tracking branch 'origin/master' into issue2266

9 years agoOnly validate targets if the spec option is empty
Ryan Quattlebaum [Fri, 8 Apr 2016 16:55:02 +0000 (12:55 -0400)]
Only validate targets if the spec option is empty

9 years agoAuto merge of #2385 - alexcrichton:top-level-overrides, r=wycats
bors [Thu, 7 Apr 2016 21:17:56 +0000 (14:17 -0700)]
Auto merge of #2385 - alexcrichton:top-level-overrides, r=wycats

Implement top-level overrides

This commit is an implementation of top-level overrides to be encoded into the
manifest itself directly. This style of override is distinct from the existing
`paths` support in `.cargo/config` in two important ways:

* Top level overrides are intended to be checked in and shared amongst all
  developers of a project.
* Top level overrides are reflected in `Cargo.lock`.

The second point is crucially important here as it will ensure that an override
on one machine behaves the same as an override on another machine. This solves
many long-standing problems with `paths`-based overrides which suffer from some
level of nondeterminism as they're not encoded.

From a syntactical point of view, an override looks like:

```toml
[replace]
"libc:0.2.0" = { git = 'https://github.com/my-username/libc';, branch = '0.2-fork' }
```

This declaration indicates that whenever resolution would otherwise encounter
the `libc` package version 0.2.0 from crates.io, it should instead replace it
with the custom git dependency on a specific branch.

The key "libc:0.2.0" here is actually a package id specification which will
allow selecting various components of a graph. For example the same named
package coming from two distinct locations can be selected against, as well as
multiple versions of one crate in a dependency graph. The replacement dependency
has the same syntax as the `[dependencies]` section of Cargo.toml.

One of the major uses of this syntax will be, for example, using a temporary
fork of a crate while the changes are pushed upstream to the original repo. This
will avoid the need to change the intermediate projects immediately, and over
time once fixes have landed upstream the `[replace]` section in a `Cargo.toml`
can be removed.

There are also two crucial restrictions on overrides.

* A crate with the name `foo` can only get overridden with packages also of
  the name `foo`.
* A crate can only get overridden with a crate of the exact same version.

A consequence of these restrictions is that crates.io cannot be used to replace
anything from crates.io. There's only one version of something on crates.io, so
there's nothing else to replace it with (name/version are a unique key).

Closes #942

9 years agoAuto merge of #2547 - alexcrichton:more-locking, r=brson
bors [Wed, 6 Apr 2016 16:56:36 +0000 (09:56 -0700)]
Auto merge of #2547 - alexcrichton:more-locking, r=brson

Add file locks in a few more locations

One was discovered by making `target_dir` return a `Filesystem`, the other was discovered by failing tests on the nightly OSX bots.

9 years agoProtect against concurrent access to Cargo.lock
Alex Crichton [Tue, 5 Apr 2016 23:32:13 +0000 (16:32 -0700)]
Protect against concurrent access to Cargo.lock

CI tests seen to be spurious failing on OSX due to this, I believe it's because
one process is concurrently writing out Cargo.lock while the other is trying to
read it in, so one of them gets a corrupt version.

This would ideally be fixed from `pkg.root()` returning a `Filesystem`, but that
was unfortunately such an invasive change that it seemed untenable. Additionally
we generally don't write files into the source tree, so if this is the only
instance it's perhaps not so bad trying to be robust in to the future.

9 years agoChange `Config::target_dir` to return Filesystem
Alex Crichton [Sat, 2 Apr 2016 01:06:20 +0000 (18:06 -0700)]
Change `Config::target_dir` to return Filesystem

This is a shared directory among multiple Cargo processes so access to it needs
to be properly synchronized. This commit changes the API of `Config::target_dir`
and then propagates the changes outward as necessary.

One fallout of this change is now we allow release/debug builds to proceed in
parallel.

9 years agoAuto merge of #2541 - alexcrichton:aarch64, r=alexcrichton
bors [Sun, 3 Apr 2016 01:17:51 +0000 (18:17 -0700)]
Auto merge of #2541 - alexcrichton:aarch64, r=alexcrichton

Download the aarch64 standard library on the bots

9 years agoDownload the aarch64 standard library on the bots
Alex Crichton [Sat, 2 Apr 2016 01:08:21 +0000 (18:08 -0700)]
Download the aarch64 standard library on the bots

9 years agoAuto merge of #2534 - alexcrichton:lock-with-git-repos, r=brson
bors [Sat, 2 Apr 2016 23:26:03 +0000 (16:26 -0700)]
Auto merge of #2534 - alexcrichton:lock-with-git-repos, r=brson

Replace existing sources before updating

Currently sources may acquire file locks to ensure that they're not tampered
with while they're in use. We may load two sources to the same location,
however, in the case of git repositories which need to be updated. Cargo will
first load a locked version of the source and then may load an unlocked version,
and these two loads currently deadlock.

This commit tweaks the logic when updating a source to only update it after the
previous source has been replaced.

Closes #2533

9 years agoAuto merge of #2538 - alexcrichton:aarch64, r=alexcrichton
bors [Sat, 2 Apr 2016 01:13:23 +0000 (18:13 -0700)]
Auto merge of #2538 - alexcrichton:aarch64, r=alexcrichton

Prepare for aarch64 nightlies and CI

9 years agoPrepare for aarch64 nightlies and CI
Alex Crichton [Sat, 2 Apr 2016 01:08:21 +0000 (18:08 -0700)]
Prepare for aarch64 nightlies and CI